package com.niit.serviceuser.client;

import com.niit.servicecommon.entity.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("service-order")
public interface OrderClient {
    
    /**
     * 查询所有订单
     */
    @GetMapping("/orders")
    List<Order> getAllOrders();
    
    /**
     * 根据ID查询订单
     */
    @GetMapping("/orders/{id}")
    Order getOrderById(@PathVariable("id") Long id);
    
    /**
     * 添加订单
     */
    @PostMapping("/orders")
    void addOrder(@RequestBody Order order);
    
    /**
     * 更新订单
     */
    @PutMapping("/orders")
    void updateOrder(@RequestBody Order order);
    
    /**
     * 删除订单
     */
    @DeleteMapping("/orders/{id}")
    void deleteOrder(@PathVariable("id") Long id);
}